//
//  YLCustomViewController.m
//  xpkc
//
//  Created by wanmeizty on 14-8-18.
//  Copyright (c) 2014年 wanmeizty. All rights reserved.
//

#import "YLCustomViewController.h"
#import <CommonCrypto/CommonDigest.h>
@interface YLCustomViewController ()

@end

@implementation YLCustomViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
//        self.tabBarItem = [[UITabBarItem alloc] init];
        [self.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                GreenColor, NSForegroundColorAttributeName,
                                                 nil] forState:UIControlStateSelected];
        

    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self creatNavItem];
    // Do any additional setup after loading the view.
    self.view.backgroundColor=RGBCOLOR(231, 236, 237);

}
- (void)creatNavItem{
    UIImage *image = [UIImage imageNamed:@"back1"];
    if (IsIOS7) {
        image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    }
    
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithImage:image style:UIBarButtonItemStyleBordered target:self action:@selector(backToLastView)];
    self.navigationItem.leftBarButtonItem = backItem;
}
- (void)backToLastView{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated{
    [[UIApplication sharedApplication]setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
    [[UIDevice currentDevice]
      setValue:[NSNumber
                numberWithInteger:UIInterfaceOrientationPortrait]
      forKey:@"orientation"];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (BOOL)shouldAutorotate{
    return NO;
}
- (NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}
-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
